//从路由的js核心中解构出创建路由的方法createRouter方法、createWebHistory方法
import { createRouter, createWebHashHistory } from 'vue-router'
//引入文件


const router = createRouter({
//路由的配置模式
  history: createWebHashHistory(import.meta.env.BASE_URL),
  //路由的路径配置
  routes: [
    // 首页
    {
      path:"/",
      component:()=>import("@/views/home/Layout.vue")
      ,
      // 管理员员工子路由
      children:[
        // 1平台首页
        {
          path: "/home",
          component: () => import("@/views/home/Home.vue"),
        },
         // 2个人中心
         {
          path: "/personal",
          component: () => import("@/views/home/Personal.vue"),
        },

        // 3管理员员工
        {
          path:"/emp",
          component:()=>import("@/views/emp/Employee.vue")
        },
          //6商家列表
        {
          path:"/businessList",
          component:()=>import("@/views/shop/businessList.vue")
        },
        //7店铺列表
        {
          path: "/shopList",
          component: () => import("@/views/shop/shopList.vue"),
        },
        //8添加店铺
        {
          path:"/addShop",
          component:()=>import("@/views/shop/Addshop.vue")
        },
         // 4平台店铺分类
         {
          path: "/shopCategory",
          component: () => import("@/views/emp/ShopCategory.vue"),
        },
        // 5平台员工审核店铺
        {
          path: "/shopAudit",
          component: () => import("@/views/emp/ShopAudit.vue"),
        },
          // 9菜品分类
          {
            path: "/foodCategory",
            component: () => import("@/views/food/FoodCategory.vue"),
          },
          // 10菜品
          {
            path: "/food",
            component: () => import("@/views/food/Food.vue"),
          },


      ]
    },
     // 平台员工
     {
      path: "/empLogin",
      name: "empLogin",
      component: () => import("@/views/emp/EmpLogin.vue"),
    },
    // 商家注册
    {
      path: "/businessRegist",
      component: () => import("@/views/shop/businessRegist.vue"),
    },
    // 商家登录
    {
      path: "/businessLogin",
      name: "businessLogin",
      component: () => import("@/views/shop/businessLogin.vue"),
    },
  ]
})

export default router
